xlat_tables_v2: find VA/idx with helper functions.
authorDavid Pu <[email protected]>
Fri, 22 Feb 2019 10:23:57 +0000 (02:23 -0800)
committerDavid Pu <[email protected]>
Thu, 28 Feb 2019 18:14:20 +0000 (10:14 -0800)
commite664b5b6ae1bdbbdfb381dfe77053ffd4df44771
treee9fd733018a75060b3de48953b6fcba2a8458c2d
parent3ff6e401f9a43dd4f6a93c8af6e4cb83f93343b5
xlat_tables_v2: find VA/idx with helper functions.

This patch introduces 2 helper functions 'xlat_tables_find_start_va' and
'xlat_tables_va_to_index' to find the first VA and table index affected by the
specified mmap region. it reduces code duplication and cyclomatic code
complexity in xlat_tables_map/unmap_region functions.

Cyclomatic complexity calculated using 'Coverity'

fixes arm-software/tf-issues#673

Signed-off-by: David Pu <[email protected]>
lib/xlat_tables_v2/xlat_tables_core.c